# coding: utf-8
from . import db, BaseModel


class AppointmentInfo(db.Model):
    __tablename__ = 'appointment_info'

    auto_id = db.Column(db.BigInteger, primary_key=True, info='自增id')
    record_id = db.Column(db.BigInteger, nullable=False, info='预约记录id')
    client_id = db.Column(db.String(20, 'utf8mb4_general_ci'), info='用户id')
    counselor_id = db.Column(db.String(20, 'utf8mb4_general_ci'), info='咨询师id')
    time_id = db.Column(db.String(20, 'utf8mb4_general_ci'), nullable=False, info='时间ID')
    appointment_status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='预约状态：\r\n0-待咨询师通过 \r\n1-咨询师已通过 \r\n2-咨询师拒绝预约 \r\n3-预约已完成\r\n4-客户请求取消预约，待咨询师通过 \r\n5-咨询师请求取消预约，待客户通过 \r\n6-预约已取消')
    cancel_reason = db.Column(db.Text(collation='utf8mb4_0900_ai_ci'), nullable=False, info='取消原因')
    request_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='申请时间')
    remark = db.Column(db.Text(collation='utf8mb4_0900_ai_ci'), nullable=False, info='备注')
    is_delete = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='逻辑删除')
    create_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='创建时间')
    update_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='更新时间')
